package com.vilicode.service.impl;


import com.vilicode.bean.Post;
import com.vilicode.mapper.PostMapper;
import com.vilicode.mapper.RecommendMapper;
import com.vilicode.service.PostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PostServiceImpl implements PostService {
    @Autowired
    public PostMapper postMapper;
    @Autowired
    public RecommendMapper recommendMapper;
    @Override
    public List<Post> queryPostByRecommendType(int rtype,int pageNumber,int pageSize)
    {
        return recommendMapper.queryPostByRecommendType(rtype,(pageNumber-1)*pageSize,pageSize);
    }
    public Post queryPostByID(int bid)
    {
        return postMapper.queryPostById(bid);

    }



}
